from copy import deepcopy


class Caluculator:
    __NUMBERS = list(range(ord('0'), ord('9') + 1)) + [ord('.')]
    __OPERATORS = [ord(c) for c in "/*-+"]
    __TARGETS = list(map(chr, __NUMBERS + __OPERATORS))

    @staticmethod
    def calculate(s: str) -> float:
        s = Caluculator.number_and_operator_filter(s)
        if not s.startswith('-'):
            s = "+" + s
        arrays = {}
        for name, char_set in zip(("numbers", "operators"), (Caluculator.__OPERATORS, Caluculator.__NUMBERS)):
            array = deepcopy(s)
            for c in char_set:
                array = array.replace(chr(c), ' ')
            arrays[name] = ' '.join(array.split()).strip().split(' ')
        arrays["numbers"] = [float(n) for n in arrays["numbers"]]
        stack_number = []
        stack_operator = []
        result = 0
        while len(arrays["numbers"]) > 0:
            operator = arrays["operators"].pop()
            stack_operator.append(operator)
            stack_number.append(arrays["numbers"].pop())
            if operator in "+-":
                result += Caluculator.calculate_stack(stack_number, stack_operator)
        return result

    @staticmethod
    def number_and_operator_filter(s: str) -> str:
        return "".join([c for c in s if c in Caluculator.__TARGETS])

    @staticmethod
    def calculate_stack(stack_number: list, stack_operator: list) -> float:
        result = 1
        while len(stack_number) > 0:
            number = stack_number.pop()
            operator = stack_operator.pop()
            if operator == '/':
                result /= number
            elif operator in "+*":
                result *= number
            elif operator == '-':
                result *= number * -1
        return result


if __name__ == "__main__":
    command = input("请输入没有括号的四则运算表达式：")
    print("结果是{:f}".format(Caluculator.calculate(command)))
